package com.Utils;

import java.io.File;
import java.net.URL;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;

public class FileUtil {

    public static File getClassPathFile(String filename) {
        URL url = FileUtil.class.getClassLoader().getResource(filename);

        if (url != null) {
            String path = URLDecoder.decode(url.getPath(), StandardCharsets.UTF_8);

            return new File(path);
        }

        return null;
    }
}
